﻿package com.gengine.ui
{
    import com.gengine.global.*;
    import flash.display.*;
    import flash.events.*;

    public class Application extends Sprite
    {

        public function Application()
        {
            return;
        }// end function

        public function initMainThread(param1:DisplayObjectContainer) : void
        {
            param1.addChildAt(this, 0);
            if (this.stage)
            {
                this.initApp();
            }
            else
            {
                this.addEventListener(Event.ADDED_TO_STAGE, this.initApp);
            }
            return;
        }// end function

        protected function initApp(event:Event = null) : void
        {
            Global.instance.initStage(this.stage);
            Global.application = this;
            return;
        }// end function

    }
}
